//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class TintEffect : Effect
    {
        private double amount;
        private double hue;

        public double Hue
        {
            get { return hue; }
            set { hue = value; }
        }

        public double Amount
        {
            get { return amount; }
            set { amount = value; }
        }

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("tint"))
            {
                Hue = c.GetOptionalDouble("hue", 0.0);
                Amount = c.GetOptionalDouble("amt", 0.0);
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write("tint"))
            {
                c.SetOptionalDouble("hue", Hue, 0.0);
                c.SetOptionalDouble("amt", Amount, 0.0);
            }
        }
    }
}